﻿using System;
using System.Net;
using System.Windows;

namespace Transportr
{
    public class MapViewModel : BaseItemViewModel
    {
        private int mZoomLevel;
        private double mCenterLatitude;
        private double mCenterLongitude;
#if WINDOWS_PHONE
        private System.Device.Location.GeoCoordinate mCenter;
#endif

        public int ZoomLevel
        {
            get
            {
                return mZoomLevel;
            }
            set
            {
                if (value != mZoomLevel)
                {
                    mZoomLevel = value;
                    NotifyPropertyChanged("ZoomLevel");
                }
            }
        }
#if WINDOWS_PHONE
        public System.Device.Location.GeoCoordinate Center
        {
            get
            {
                return new System.Device.Location.GeoCoordinate(mCenterLatitude, mCenterLongitude);
            }
            set
            {
                if (value != mCenter)
                {
                    mCenter = value;
                    NotifyPropertyChanged("Center");
                    NotifyPropertyChanged("CenterLatitude");
                    NotifyPropertyChanged("CenterLongitude");
                }
            }
        }
#endif
        public double CenterLatitude
        {
            get
            {
                return mCenterLatitude;
            }
            set
            {
                if (value != mCenterLatitude)
                {
                    mCenterLatitude = value;
                    NotifyPropertyChanged("Center");
                    NotifyPropertyChanged("CenterLatitude");
                }
            }
        }

        public double CenterLongitude
        {
            get
            {
                return mCenterLongitude;
            }
            set
            {
                if (value != mCenterLongitude)
                {
                    mCenterLongitude = value;
                    NotifyPropertyChanged("Center");
                    NotifyPropertyChanged("CenterLongitude");
                }
            }
        }
    }
}
